/*
 * Dist_Dist_1_Transition.cpp
 *
 * Transition from Distance mode state to itself.
 * This transition's action start/stop calculations
 *
 * Author: Zachary Masiello
 * Author: Peter-John Rowe
 */

#include "Dist_Dist_1_Transition.h"
#include "Cyclometer.h"

Dist_Dist_1_Transition::Dist_Dist_1_Transition(Cyclometer* cyclo,IState* defNextState,int id) {
	context = cyclo;
	nextState = defNextState;
	eventID = id;
}

Dist_Dist_1_Transition::~Dist_Dist_1_Transition() {
	// TODO Auto-generated destructor stub
}

IState* Dist_Dist_1_Transition::accept() {
	action();
	return nextState;
}

bool Dist_Dist_1_Transition::guard() {
	return context->isCalcModeM();
}

void Dist_Dist_1_Transition::action() {
	context->startStopCalc();
}
